package Tests.figuren;

import java.util.ArrayList;


import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import schach.server.model.Bauer;
import schach.server.model.Brett;
import schach.server.model.Feld;
import schach.server.model.Figur;

public class BauerTest {

	private static ArrayList<ArrayList<Feld>> felder;
	private ArrayList<Feld> crossed;
	private Figur figur;

	@BeforeClass
	public static void firstSetUp() {
		Brett brett = new Brett();
		felder = brett.getFelder();

	}

	@Before
	public void setUp() {
		Feld feld = felder.get(1).get(1);
		figur = new Bauer(feld, true, false);
		feld.setFigur(figur);
		System.out.println(figur.getPosition().toString());
		crossed = new ArrayList<Feld>();

	}

	@Test
	public void testeTurm() {

		try {
			if (figur.getClass().toString().equals("class defau.Bauer")) {
				System.out.println("Tolle Sache");
				Bauer bauer = (Bauer) figur;
				crossed = bauer.crossedFields(felder.get(0).get(2), true);
				figur.move(felder.get(0).get(2));
				System.out
						.println(felder.get(0).get(2).toString() + " korrekt");
			}
			// crossed = figur.crossedFields(felder.get(0).get(3));
			// figur.move(felder.get(0).get(3));
			// System.out.println(felder.get(0).get(3).toString() + " korrekt");
		} catch (Exception e) {
			System.out.println("Error");
		}
		try {
			crossed = figur.crossedFields(felder.get(0).get(4));
			figur.move(felder.get(0).get(4));
			System.out.println(felder.get(0).get(4).toString() + " korrekt");
		} catch (Exception e) {
			System.out.println("Dinko!!!");
		}
	}
}